package z_app_lotto;

import java.awt.*;
import java.util.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class Sim2 extends JPanel {
    Vector v;
    int result[];
    int term[];
    public Sim2(Vector v) {
        this.v = v;
        result = new int[v.size()];
        term = new int[v.size()];

        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        this.setLayout(null);
        jTextField1.setText("1");
        jTextField1.setBounds(new Rectangle(44, 18, 55, 20));
        jLabel1.setText("번호");
        jLabel1.setBounds(new Rectangle(17, 19, 45, 19));
        jButton1.setBounds(new Rectangle(106, 16, 63, 22));
        jButton1.setText("확인");
        jButton1.addActionListener(new Sim2_jButton1_actionAdapter(this));
        jScrollPane1.setBounds(new Rectangle(5, 49, 770, 471));
        this.add(jLabel1);
        this.add(jButton1);
        this.add(jTextField1);
        this.add(jScrollPane1);
        jScrollPane1.getViewport().add(jTextArea1);
    }

    JTextField jTextField1 = new JTextField();
    JLabel jLabel1 = new JLabel();
    JButton jButton1 = new JButton();
    JScrollPane jScrollPane1 = new JScrollPane();
    JTextArea jTextArea1 = new JTextArea();

    //확인 바튼
    public void jButton1_actionPerformed(ActionEvent e) {
        String parse[] = new String[8];
        int cnt = 0;
        String buf = new String();
        boolean flag=false;

        // data parse
        for(int i=0 ; i<v.size(); i++){
             buf= (String)v.elementAt(i);
            parse = buf.split(",");

            for(int j=1; j<8; j++){
                if(jTextArea1.getText() == parse[j]){
                    result[cnt] = Integer.parseInt(parse[0]);
                    cnt++;
                }
            }








        }


    }
}


class Sim2_jButton1_actionAdapter implements ActionListener {
    private Sim2 adaptee;
    Sim2_jButton1_actionAdapter(Sim2 adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton1_actionPerformed(e);
    }
}
